<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>公司管理</title>
    <th:block th:include="statics/common/page/header"></th:block>
    <link rel="stylesheet" th:href="@{../statics/css/upload-template.css}"/>
</head>
<body>
<div id="companyInfo" v-cloak>
	<div v-show="showList">
        <Row class="search-panel-space">
            <div class="search-group">
                <i-col span="5">
                	<label class="search-label-20">名称:</label>
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称" class="search-item-width-75"/>
                </i-col>
                <!-- <i-col span="6">
                	<label class="search-label-20">公司法人:</label>
                    <i-input v-model="q.legal" @on-enter="query" placeholder="公司法人" class="search-item-width-75"/>
                </i-col> -->
                <i-col span="5">
                	<label class="search-label-20">联系人:</label>
                    <i-input v-model="q.attn" @on-enter="query" placeholder="联系人" class="search-item-width-75"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>    
        <Row :gutter="16">
            <div class="buttons-group">
                <i-button type="info" @click="add" th:if="${@shiroAuthService.hasPermission('org:companyinfo:save')}">
                	<i class="fa fa-plus"></i>&nbsp;新增</i-button>
                <i-button type="warning" @click="update" th:if="${@shiroAuthService.hasPermission('org:companyinfo:update')}">
                	<i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                <i-button type="error" @click="audit" th:if="${@shiroAuthService.hasPermission('org:companyinfo:audit')}">
                	<i class="fa fa-trash-o"></i>&nbsp;审核</i-button>
                <i-button type="error" @click="del" th:if="${@shiroAuthService.hasPermission('org:companyinfo:delete')}">
                	<i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                <i-button type="error" @click="freeze" th:if="${@shiroAuthService.hasPermission('org:companyinfo:freeze')}">
                	<i class="fa fa-trash-o"></i>&nbsp;冻结</i-button>
            </div>
        </Row>
	    <table id="companyInfoGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title" style="height: 35px;">{{title}}
        	<i-button type="warning" @click="reload" style="margin-right: 8px;float: right;"/>返回</i-button>
        </p>
		<i-form ref="formValidate" :model="orgCompanyInfo" :rules="ruleValidate" :label-width="120">
            <Form-item label="公司简称" prop="name" style="width: 450px;">
                <i-input v-model="orgCompanyInfo.name" placeholder="公司简称" :disabled="showAuditDetail"/>
            </Form-item>
            <Form-item label="公司全称" prop="allName" style="width: 450px;">
                <i-input v-model="orgCompanyInfo.allName" placeholder="公司全称" :disabled="showAuditDetail"/>
            </Form-item>
            <!-- <Form-item label="公司类型" prop="type" style="width: 450px;">
                <Radio-group v-model="orgCompanyInfo.type" :disabled="showAuditDetail">
                    <Radio label="1">
                        <span>集团</span>
                    </Radio>
                    <Radio label="2">
                        <span>公司</span>
                    </Radio>
                </Radio-group>
            </Form-item> -->
            <Form-item label="公司编号" prop="serialNo" style="width: 450px;">
                <i-input v-model="orgCompanyInfo.serialNo" placeholder="公司编号" :disabled="showAuditDetail"/>
            </Form-item>
            <Form-item label="公司地址" prop="address" style="width: 600px;">
            	<!-- <i-col span="8">
            		<i-select v-model="orgCompanyInfo.provinceId" placeholder="请选择省份" @on-change="selectProvince">
	                    <i-option v-for="province in provinceList" :value="province.id" :key="province.id">{{province.name}}</i-option>
	                </i-select>
            	</i-col>
            	<i-col span="8">
	                <i-select v-model="orgCompanyInfo.cityId"  placeholder="请选择城市" @on-change="selectCity">
	                    <i-option v-for="city in cityList" :value="city.id" :key="city.id">{{city.name}}</i-option>
	                </i-select>
            	</i-col>
            	<i-col span="8">
	                <i-select v-model="orgCompanyInfo.areaId" ref="companyInfoArearesetSelect" placeholder="请选择县/区" @on-change="selectArea" clearable>
	                    <i-option v-for="area in areaList" :value="area.id" :key="area.id">{{area.name}}</i-option>
	                </i-select>
            	</i-col> -->
                <i-input v-model="orgCompanyInfo.address" placeholder="公司详细" :disabled="showAuditDetail"/>
            </Form-item>
            <!-- <Form-item label="营业执照" prop="license" style="width: 450px;">
                <div class="multiple-template-upload-list" v-for="item in uploadLicenseList">
			        <template v-if="item.status === 'finished' ">
			            <img :src="item.url">
			            <div class="multiple-template-upload-list-cover">
			                <Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
			                <Icon type="ios-trash-outline" @click.native="handleRemove('license')"></Icon>
			            </div>
			        </template>
			        <template v-else>
			        	<img th:src="@{../statics/img/loading.gif}">
			        	<i-progress :percent="item.percentage" hide-info></i-progress>
			        </template>
			    </div>
            
            	<Upload v-if="!showAuditDetail" ref="uploadLicenseref" :show-upload-list="false" :default-file-list="uploadLicenseList" :on-success="handleSuccessLicense"
			        :format="['jpg','jpeg','png']" :max-size="4096" :on-format-error="handleImgFormatError" :on-exceeded-size="handleImgMaxSize"
			        :before-upload="handleLicenseImgBeforeUpload" multiple action="/sysUpload/uploadImg" style="display: inline-block;width:58px;">
			        <div class="multiple-template-upload-list" style="border: darkgrey 1px dashed;">
			        	<Icon type="camera" size="20"></Icon>
			        </div>
			    </Upload>
            </Form-item> -->
            <!-- <Form-item label="公司标识" prop="logo" style="width: 450px;">
                <div class="multiple-template-upload-list" v-for="item in uploadLogoList">
			        <template v-if="item.status === 'finished' ">
			            <img :src="item.url">
			            <div class="multiple-template-upload-list-cover">
			                <Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
			                <Icon type="ios-trash-outline" @click.native="handleRemove('logo')"></Icon>
			            </div>
			        </template>
			        <template v-else>
			        	<img th:src="@{../statics/img/loading.gif}">
			        	<i-progress :percent="item.percentage" hide-info></i-progress>
			        </template>
			    </div>
            
            	<Upload v-if="!showAuditDetail" ref="uploadLogoref" :show-upload-list="false" :default-file-list="uploadLogoList" :on-success="handleSuccessLogo"
			        :format="['jpg','jpeg','png']" :max-size="4096" :on-format-error="handleImgFormatError" :on-exceeded-size="handleImgMaxSize"
			        :before-upload="handleLogoImgBeforeUpload" multiple action="/sysUpload/uploadImg" style="display: inline-block;width:58px;">
			        <div class="multiple-template-upload-list" style="border: darkgrey 1px dashed;">
			        	<Icon type="camera" size="20"></Icon>
			        </div>
			    </Upload>
            </Form-item> -->
            <!-- <Form-item label="联系人" prop="attn" style="width: 450px;" v-if="orgCompanyInfo.id">
                <i-input v-model="orgCompanyInfo.attn" placeholder="联系人" icon="eye" @on-click="selectCompanyEmployee" disabled/>
            </Form-item> -->
            <Form-item label="联系人电话" prop="phone" style="width: 450px;" v-if="orgCompanyInfo.id">
                <i-input v-model="orgCompanyInfo.phone" placeholder="联系人电话" disabled/>
            </Form-item>
            <Form-item label="联系人" prop="attn" style="width: 450px;" v-if="!orgCompanyInfo.id">
                <i-input v-model="orgCompanyInfo.attn" placeholder="联系人" :disabled="showAuditDetail"/>
            </Form-item>
            <Form-item label="联系人电话" prop="phone" style="width: 450px;" v-if="!orgCompanyInfo.id">
                <i-input v-model="orgCompanyInfo.phone" placeholder="联系人电话" :disabled="showAuditDetail"/>
            </Form-item>
            <!-- <Form-item label="公司法人" prop="legal" style="width: 450px;">
                <i-input v-model="orgCompanyInfo.legal" placeholder="公司法人" :disabled="showAuditDetail"/>
            </Form-item> -->
            <!-- <Form-item label="法人身份证正面" prop="idcardPositive" style="width: 450px;">
                <div class="multiple-template-upload-list" v-for="item in uploadIdcardPositiveList">
			        <template v-if="item.status === 'finished' ">
			            <img :src="item.url">
			            <div class="multiple-template-upload-list-cover">
			                <Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
			                <Icon type="ios-trash-outline" @click.native="handleRemove('idcardPositive')"></Icon>
			            </div>
			        </template>
			        <template v-else>
			        	<img th:src="@{../statics/img/loading.gif}">
			            <i-progress :percent="item.percentage" hide-info></i-progress>
			        </template>
			    </div>
            
            	<Upload v-if="!showAuditDetail"  ref="uploadIdcardPositiveref" :show-upload-list="false" :default-file-list="uploadIdcardPositiveList" :on-success="handleSuccessIdcardPositive"
			        :format="['jpg','jpeg','png']" :max-size="4096" :on-format-error="handleImgFormatError" :on-exceeded-size="handleImgMaxSize"
			        :before-upload="handleIdcardPositiveImgBeforeUpload" multiple action="/sysUpload/uploadImg" style="display: inline-block;width:58px;">
			        <div class="multiple-template-upload-list" style="border: darkgrey 1px dashed;">
			        	<Icon type="camera" size="20"></Icon>
			        </div>
			    </Upload>
            </Form-item> -->
            <!-- <Form-item label="法人身份证反面" prop="idcardReverse" style="width: 450px;">
                <div class="multiple-template-upload-list" v-for="item in uploadIdcardReverseList">
			        <template v-if="item.status === 'finished' ">
			            <img :src="item.url">
			            <div class="multiple-template-upload-list-cover">
			                <Icon type="ios-eye-outline" @click.native="handleView(item)"></Icon>
			                <Icon type="ios-trash-outline" @click.native="handleRemove('idcardReverse')"></Icon>
			            </div>
			        </template>
			        <template v-else>
			        	<img th:src="@{../statics/img/loading.gif}">
			        	<i-progress :percent="item.percentage" hide-info></i-progress>
			        </template>
			    </div>
            
            	<Upload v-if="!showAuditDetail" ref="uploadIdcardReverseref" :show-upload-list="false" :default-file-list="uploadIdcardReverseList" :on-success="handleSuccessIdcardReverse"
			        :format="['jpg','jpeg','png']" :max-size="4096" :on-format-error="handleImgFormatError" :on-exceeded-size="handleImgMaxSize"
			        :before-upload="handleIdcardReverseImgBeforeUpload" multiple action="/sysUpload/uploadImg" style="display: inline-block;width:58px;">
			        <div class="multiple-template-upload-list" style="border: darkgrey 1px dashed;">
			        	<Icon type="camera" size="20"></Icon>
			        </div>
			    </Upload>
            </Form-item> -->
            <Form-item label="公司电话" prop="tel" style="width: 450px;">
                <i-input v-model="orgCompanyInfo.tel" placeholder="公司电话" :disabled="showAuditDetail"/>
            </Form-item>
            <!-- <Form-item label="常用品牌" prop="brandList" style="width: 450px;" v-show="orgCompanyInfo.type==2">
            	<i-button type="primary" shape="circle" icon="ios-search" @click="selectBrandAll">选择车辆品牌</i-button>
           		<tag v-for="brandItem in orgCompanyInfo.brandList" type="dot" color="warning" :key="brandItem.id" :name="brandItem.id" closable @on-close="handleBrandRemove">{{brandItem.brand}}</tag>
            </Form-item> -->
            <Form-item v-if="!showAuditDetail">
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
            <Form-item v-if="showAuditDetail &&vm.orgCompanyInfo.status>1">
                <i-button type="primary" @click="auditYes()">审核通过</i-button>
                <i-button type="ghost" @click="auditNo()" style="margin-left: 8px">审核不通过</i-button>
            </Form-item>
            <p v-if="showAuditDetail && vm.orgCompanyInfo.status<=1">
            	该信息已审核
            </p>
        </i-form>
	</Card>
	
</div>

<script th:src="@{../statics/js/org/companyinfo.js}"></script>
</body>
</html>